/**
 * Exports order function to Euclid
 * 
 * @author Jon Ludwig
 *
 */

import Euclid.*;

public class EuclidExport implements EuclidExporter {
	
	public String[] getExports()
	{
		return new String[] { "order" };
	}
	
	public VarType order(VarType a, VarType n) {
		if (a instanceof SymbVarType)
			return order(((SymbVarType)a).val, n);
		else if (n instanceof SymbVarType)
			return order(a, ((SymbVarType)n).val);
		else if ((a instanceof IntVarType) && (n instanceof IntVarType))
			return new IntVarType(Order.order(((IntVarType)a).val, ((IntVarType)n).val),
					"\\mathrm{ord}_{" + n.formula + "}(" + a.formula + ")");
		else
			return null;
	}

}
